<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加景点等级-景点-西博信息平台-网上会展信息发布平台</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/base.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/page.css" type="text/css" media="screen" />

<script src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/js/common.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/js/swfupload/swfupload.js" type="text/javascript" ></script>
<script src="${pageContext.request.contextPath}/common/js/swfupload/myswf.js" type="text/javascript" ></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidator.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidatorregex.js"></script>
<script src="${pageContext.request.contextPath}/common/js/pagetab.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$.formValidator.initConfig({formid:"form",autotip:true});
	$("#name").formValidator({onshow:"请输入房型名称",onfocus:"房型名称不能为空。"}).inputValidator({min:1,max:30,onerror:"房型名称不能多于30位。"});
	$("#roomNum").formValidator({onshow:"请输入房间数",onfocus:"请输入房间数",oncorrect:"输入房间数正确"}).regexValidator({regexp:"num1",datatype:"enum",onerror:"请输入正确的房间数"});
	$("#price").formValidator({onshow:"请输入门市价",onfocus:"请输入门市价",oncorrect:"输入门市价正确"}).regexValidator({regexp:"decmal4",datatype:"enum",onerror:"请输入正确的门市价"});
	$("#sort").formValidator({onshow:"请输入排序",onfocus:"排序不能为空。"}).regexValidator({regexp:"num1",datatype:"enum",onerror:"请输入正确的排序"});
	
})

      $(function(){
	$.ajax({
		   type: "POST",
		   dataType:"json",
		   url: "${pageContext.request.contextPath}/panel/hotel/bedType/bedType!getBedTypeLists.action",
		   success: function(json){
		     $.each(json.rows, function(i,o) {
					$("#bedType").append('<label><input name="roomStyle.bedType" type="radio" value="'+o.id+'"/>'+o.name+'</label>');
					})
			}
		});
    })
</script>
<script type="text/javascript">

$(function(){
	myswf({'basepath':'${pageContext.request.contextPath}','type':'image','buttonholder':'spanButtonPlaceHolder','success':imageuploadsuc});
    
})
function mytoolTip(url)
{
	if(!url)toolTip();
	else toolTip('<img src="${pageContext.request.contextPath}/'+$(url).val()+'">');
}
function imageuploadsuc(data)
{
	$("#swf_image").html('<input type="text" name="roomStyle.picUrl" class="tx5" value="'+data.url+'" onmousemove="mytoolTip(this)" onmouseout="mytoolTip()"/>');
}

function submit1()
{
	$("#url").val('panel/hotel/roomStyle/getRoomStyleListByPage.action');
	$("#form").submit();
}
function submit2()
{
	$("#form").submit();
}



</script>
</head>
<body>
<form id="form" action="save.action" method="post">
<input type="hidden" name="url" id="url"/>	
<div id="main_frame">	
	<div id="pagemenu"><a href="getRoomStyleListByPage.action" title="酒店房型">酒店房型</a>|<a href="javascript:void();" title="添加房型" class="selected">添加房型</a></div>	
	<div class="listtitle">
		<ul>
			<li class="selected"><a href="javascript:void(0);" title="基本信息">基本信息</a></li>
			<li><a href="javascript:void(0);" title="扩展信息">扩展信息</a></li>
			</ul>
	</div>
	<div class="listbox">
			<div>	
			<table class="addtab"  align="center">
					<tr>
						<th>房型名称</th>
						<td><input type="text" class="tx6" id="name" name="roomStyle.name"/></td>
					</tr>
					<tr>
						<th>房间数</th>
						<td><input type="text" class="tx6" id="roomNum" name="roomStyle.roomNum" value="0"/></td>
					</tr>
					<tr>
						<th>门市价</th>
						<td><input type="text" class="tx6" id="price" name="roomStyle.price"/></td>
					</tr>
					<tr>
						<th>床型</th>
						<td id="bedType">
						</td>
					</tr>
					</table>
		             </div>
					<div class="hidden">
			   <table class="addtab"  align="center">
					<tr>
						<th>排序</th>
						<td><input type="text" class="tx3" id="sort" name="roomStyle.sort" value="0"/></td>
					</tr>
					
					<tr>
						<th>早餐状态</th>
						<td>
						<select id="breakfast" name="roomStyle.breakfast" title="">
						<option value="0">无</option>
						<option value="1">免费</option>
						<option value="2">收费</option>		
						</select>
						</td>
					</tr>
					<tr>
						<th>宽带状态</th>
						<td>
						<select id="broadband" name="roomStyle.broadband" title="">
						<option value="0">无</option>
						<option value="1">免费</option>
						<option value="2">收费</option>						
						</select>
						</td>
					</tr>
					<tr>
						<th>房间图片</th>
						<td><div class="fl" id="swf_image"></div><input id="spanButtonPlaceHolder"/></td>
					</tr>
					<tr>
						<th>备注</th>
						<td><textarea id="textarea" class="tex3" name="roomStyle.remark"></textarea></td>
					</tr>				
				</table>
			</div>
			</div>
			</div>
		</form>
<div id="bottombar">
	<div class="fr btns"><input onclick="submit1();" type="button" value="保存后返回" class="savebtn1"/><input type="button" onclick="submit2();" value="保存并继续" class="savebtn1" /><input type="button" value="取消" class="cancelbtn" onclick="history.go(-1)"/></div>
</div>
<script src="${pageContext.request.contextPath}/common/js/ToolTip.js" type="text/javascript"></script>
</body>
</html>